package com.pig4cloud.pig.base.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pig.base.api.dto.LogDto;
import com.pig4cloud.pig.base.service.LogService;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.security.annotation.Inner;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springdoc.api.annotations.ParameterObject;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;

/**private final SysOauthClientDetailsService clientDetailsService;
 * packageName com.pig4cloud.pig.base.controller
 *
 * @author marco
 * @className LogController (此处以class为例)
 * @date 2024/5/30
 * @description TODO
 */
@RestController
@AllArgsConstructor
@RequestMapping("/log")
@Tag(description = "log", name = "日志聚合管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class LogController {
	private final LogService logService;
	/**
	 * 简单分页查询
	 * @param page 分页对象
	 * @param logDto 日志聚合
	 * @return
	 */
	@GetMapping("/page")
	public R getOauthClientDetailsPage(@ParameterObject Page page,
									   @ParameterObject LogDto logDto) throws IOException {
		return R.ok(logService.PageQuery(page,logDto));
	}
}
